//
//  cellOfFirst.m
//  mintHome
//
//  Created by 朱彦名 on 16/6/16.
//  Copyright © 2016年 朱彦名. All rights reserved.
//

#import "cellOfFirst.h"
#import "viewOfTag.h"
#import "modelOfMintHome.h"
#import "DataOfModel.h"
@interface cellOfFirst ()

@end
@implementation cellOfFirst
- (void)dealloc{
    [_imageOfMint release];
    [_labelOfTitle release];
    [_viewOfTag release];

    [super dealloc];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubviews];
        self.imageOfMint.userInteractionEnabled = YES;
        
        
    }
    return self;

}
- (void)creatSubviews{
    self.imageOfMint = [[UIImageView alloc]init];
    [self.contentView addSubview:self.imageOfMint];
    
    //self.imageOfMint.backgroundColor = [UIColor redColor];
    
    self.labelOfTitle = [[UILabel alloc]init];
    [self.imageOfMint addSubview:self.labelOfTitle];
    //self.labelOfTitle.backgroundColor = [UIColor orangeColor];
    self.labelOfTitle.textColor = [UIColor whiteColor];
    
    self.viewOfTag = [[viewOfTag alloc]init];
    [self.contentView addSubview:self.viewOfTag];
    self.viewOfTag.backgroundColor = [UIColor clearColor];
    
    self.viewOfTag.buttonOfTag = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.viewOfTag addSubview: self.viewOfTag.buttonOfTag];
    

    
}
- (void)layoutSubviews{

    [super layoutSubviews];
    
    self.imageOfMint.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 10);
    
    self.labelOfTitle.frame = CGRectMake(0, self.frame.size.height / 5 * 4 - 20, self.frame.size.width / 3 * 2, (self.frame.size.height - 10) / 4);
    
    self.viewOfTag.frame = CGRectMake(self.frame.size.width / 3 * 2, 10, self.frame.size.width / 3 - 10, 40);
    
    self.viewOfTag.buttonOfTag.frame = CGRectMake(0, 0, self.viewOfTag.bounds.size.width /3 , 40);
    [self.viewOfTag.buttonOfTag setImage:[UIImage imageNamed:@"xihuan"] forState:UIControlStateNormal];
    


}

@end
